/*
*
* 关注---实体类
*
* */

///关注列表-粉丝列表
class Attention{
  int hasNext;
  int lastTime;
  int lastId;
  String lastIdStr;
  int lastScore;
  List list=[];
  int totalPage;
  int totalCount;


  Attention.fromJson(Map<String, dynamic> json) {
    hasNext = json["hasNext"];
    lastTime = json["lastTime"];
    lastId = json["lastId"];
    lastIdStr=json["lastIdStr"];
    lastScore = json["lastScore"];
    if (json["list"] != null) {
      json["list"].forEach((v) {
        if (v is AttentionInformation) {
          list.add(v);
        } else {
          list.add(AttentionInformation.fromJson(v));
        }
      });
    }
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["hasNext"] = hasNext;
    map["lastTime"] = lastTime;
    map["lastId"] = lastId;
    map["lastScore"] = lastScore;
    map["lastIdStr"] =lastIdStr;
    map["list"] = list;
    return map;
  }

  Attention({this.hasNext, this.lastTime, this.lastId, this.lastIdStr,
      this.lastScore, this.list, this.totalPage, this.totalCount});

  @override
  String toString() {
    return toJson().toString();
  }
}

///关注信息
class AttentionInformation{
  int uid;//用户Id
  String avatarUri;//用户头像
  String nickName;//用户昵称
  String description;//用户说说
  int relation;//0-未关注 1-关注 2-粉丝 3-互相关注

  AttentionInformation({
      this.uid, this.avatarUri, this.nickName, this.description, this.relation});

  @override
  String toString() {
    return toJson().toString();
  }

  AttentionInformation.fromJson(Map<String, dynamic> json) {
    uid = json["uid"];
    avatarUri = json["avatarUri"];
    nickName = json["nickName"];
    description=json["description"];
    relation = json["relation"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["uid"] = uid;
    map["avatarUri"] = avatarUri;
    map["nickName"] = nickName;
    map["description"] = description;
    map["relation"] =relation;
    return map;
  }

}



///关注数、粉丝数、获赞数、动态数
class GetFollowCounts{
  int uid;//用户Id
  int followingCount;//动态数
  int followerCount;//关注数
  int feedCount;//粉丝数
  int laudedCount;//获赞数

  GetFollowCounts({this.uid, this.followingCount, this.followerCount,
      this.feedCount, this.laudedCount});

  @override
  String toString() {
    return toJson().toString();
  } //获赞数

  GetFollowCounts.fromJson(Map<String, dynamic> json) {
    uid = json["uid"];
    followingCount = json["followingCount"];
    followerCount = json["followerCount"];
    feedCount=json["feedCount"];
    laudedCount = json["laudedCount"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["uid"] = uid;
    map["followingCount"] = followingCount;
    map["followerCount"] = followerCount;
    map["feedCount"] = feedCount;
    map["laudedCount"] =laudedCount;
    return map;
  }
}

///获取记录的体重信息
class GetMyWigets{
  double targetWeight;//目标体重
  List recordList=[];
  int page;

  GetMyWigets({this.targetWeight, this.recordList,this.page}); //体重列表



  GetMyWigets.fromJson(Map<String, dynamic> json) {
    targetWeight = json["targetWeight"];
    if (json["recordList"] != null) {
      json["recordList"].forEach((v) {
        if (v is GetRecordLists) {
          print(v);
          recordList.add(v);
        } else {
          recordList.add(GetRecordLists.fromJson(v));
        }
      });
    }

  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["targetWeight"] = targetWeight;
    map["recordList"] = recordList;
    return map;
  }
}

///体重列表

class GetRecordLists{
  int id;//记录id
  double weight;//体重记录
  String dateTime;

  GetRecordLists({this.id, this.weight, this.dateTime}); //记录时间



  GetRecordLists.fromJson(Map<String, dynamic> json) {
    id = json["id"];
    weight = json["weight"];
    dateTime = json["dateTime"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"] = id;
    map["weight"] = weight;
    map["dateTime"] = dateTime;
    return map;
  }

  @override
  String toString() {
    // TODO: implement toString
    return toJson().toString();
  }
}